home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / library / help / tcl / tclshell / intro < prev    next >
Encoding:
Text File  |  1993-10-26  |  4.5 KB  |  87 lines  |  [TEXT/$Tcl]

  1.  
  2.           tcl ?-qn? ?-f? script?|?-c command? ?args?
  3.  
  4.           Tcl starts the interactive Tcl command interpreter.  The Tcl
  5.           shell  provides  an  environment  for writing, debugging and
  6.           executing Tcl scripts.  The functionality of the  Tcl  shell
  7.           can be easily obtained by any application that includes Tcl.
  8.  
  9.           The tcl command, issued without any  arguments,  invokes  an
  10.           interactive   Tcl  shell,  allowing  the  user  to  interact
  11.           directly with Tcl, executing any Tcl commands  at  will  and
  12.           viewing their results.
  13.  
  14.           If script is specified, then the  script  is  executed  non-
  15.           interactively  with  any  additional  arguments, args, being
  16.           supplied in the global Tcl variable `argv'.  If  command  is
  17.           supplied,  then  this command (or semicolon-separated series
  18.           of commands) is executed, with `argv' containing any args.
  19.  
  20.           The Tcl shell is intended as an environment for Tcl  program
  21.           development  and execution.  While it is not a full-featured
  22.           interactive shell, it provides a comfortable environment for
  23.           the  interactive  development  of  Tcl  code.  Note that the
  24.           package library code described here  overrides  the  unknown
  25.           command  provided  as  part  of  the  standard  Berkeley Tcl
  26.           library facility, although Tcl  source  libraries  coded  to
  27.           that standard can be loaded and used by Extended Tcl.
  28.  
  29.           The following command line flags are recognized by  the  Tcl
  30.           shell command line parser:
  31.  
  32.           -q   Quick initialization flag.  The Tcl initiaization  file
  33.                is not evaluated and the auto_path variable is not set.
  34.                Tcl auto-load libraries will not be available.
  35.  
  36.           -n   No procedure call stack dump.  The procedure call stack
  37.                will  not  be  displayed when an error occurs, only the
  38.                error message.   Useful  in  the  #!  line  of  already
  39.                debugged scripts.
  40.  
  41.           -f   Takes the next argument as a script for Tcl to  source,
  42.                rather  than entering interactive mode.  The -f flag is
  43.                optional.  Normally the first argument  that  does  not
  44.                start  with  a  `-'  is  taken as the script to execute
  45.                unless the `-c' option  is  specified.   Any  following
  46.                arguments  are  passed to the script via argv, thus any
  47.                other Tcl shell command-line flags  must  precede  this
  48.                option.
  49.  
  50.           -c   Take the next argument as a Tcl command to execute.  It
  51.                may contain series of commands to execute, separated by
  52.                `;'.  Any following arguments are passed in argv, thus,
  53.                as with -f, any other Tcl shell flags must precede this
  54.                option.
  55.  
  56.           --   Mark the end of the arguments to  the  Tcl  shell.  All
  57.                arguments following this are passed in the Tcl variable
  58.                argv.   This  is  useful  to  pass  arguments   without
  59.                attempting to execute a Tcl script.
  60.  
  61.           The result string returned by a command  executed  from  the
  62.           Tcl  shell command line is normally echoed back to the user.
  63.           If an error occurs, then the  string  result  is  displayed,
  64.           along  with  the  error  message.  The error message will be
  65.           preceded by the string ``Error:''.
  66.  
  67.           The set command is a special case.  If the command is called
  68.           to set a variable (i.e. with two arguments), then the result
  69.           will not be echoed.  If only one argument,  the  name  of  a
  70.           variable,  is  supplied  to  set,  then  the  result will be
  71.           echoed.
  72.  
  73.           If an unknown Tcl command is entered from the command  line,
  74.           then  the  Unix  command  path, specified in the environment
  75.           variable PATH, will be searched for a command  of  the  same
  76.           name.  If the command is found, it will be executed with any
  77.           arguments remaining on the Tcl command line being passed  as
  78.           arguments  to  the  command.   This  feature  is provided to
  79.           enhance  the  interactive  environment  for  developing  Tcl
  80.           scripts.
  81.  
  82.           Automatic execution of programs in this manner is only  sup-
  83.           ported from the command line, not in script files or in pro-
  84.           cedures, to reduce confusion and mistakes while  programming
  85.           in  Tcl.  Scripts should use the Tcl exec or system commands
  86.           to run Unix commands.
  87.